package xyz.xwls.bootadmin.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.xwls.bootadmin.common.CommonResult;
import xyz.xwls.bootadmin.component.BaseController;
import xyz.xwls.bootadmin.sys.domain.Tree;
import xyz.xwls.bootadmin.sys.service.AuthService;
import xyz.xwls.bootadmin.sys.vo.AuthVo;

import java.util.List;

/**
 * @author WZW
 * @date 2020/4/22
 */
@RestController
@RequestMapping("/auth")
public class AuthController extends BaseController {

    @Autowired
    private AuthService authService;

    @GetMapping("/list")
    public CommonResult<List<Tree<AuthVo>>> list(){
        List<Tree<AuthVo>> authTree = authService.getAuthTree();
        return CommonResult.success(authTree);
    }

}
